<form id="from1" name="form_login" action="" >
 <tr>
         <td width="50" height="30"><div align="center">用户名:</div></td>
         <td width="130">&nbsp;<input type="text" size="16" class="inputcss" name="usernc" id="input1"></td>
       </tr>
       <tr>
         <td height="30"><div align="center">密码:</div></td>
         <td height="30">&nbsp;<input type="password" size="16" class="inputcss" name="userpwd" id="input2"></td>
       </tr>
       <tr>
         <td height="30" colspan="2"><div align="center"><input type="submit" value="登录" class="buttoncss">&nbsp;&nbsp;<input type="reset" value="重置" class="buttoncss" ></div></td>
       </tr>
<!-- chkuserlogin.php -->
<!-- $_POST["userpwd"];
$_POST["usernc"]; -->
 </form>
 <script type="text/javascript" src="http://yandudu.com/jquery.min.js"></script>
<script>
document.getElementById('from1').onsubmit = function() {

var xhr = new XMLHttpRequest();
var inps = [];
inps[0] = document.getElementById("input1").value;
inps[1] = document.getElementById("input2").value;
//var inps = document.getElementsByTagName('input');
xhr.open('POST' , 'chkuserlogin.php' , true);
xhr.setRequestHeader('Content-Type' , 'application/x-www-form-urlencoded');
xhr.send('usernc='+inps[0] + '&userpwd='+inps[1]);
// return false;
}

// function (_openid, callback) {
//     var url = this.geturl + "GetGates.php";
//     var para = { openid: _openid };
//     $.get(url, para, function (result) {
//         if (typeof (callback) != 'undefined') {
//             callback(result);
//         }
//     }, "json");
// }
</script>
